/* @flow */
'use strict';

var React = require('react-native');

var {
  StyleSheet,
  View,
  WebView,
} = React;

var News_DetailView = React.createClass({


  startLoading:function(){
    return (
        <ActivityIndicatorIOS
              style={[styles.activityIndicatorIOSStyle, styles.gray, {height: 40}]}
              color="#0000ff"/>);
  },

  render: function() {
  	var news_item = this.props.newsItem;
  	console.log(news_item);
    return (
      <WebView url={news_item.url} 
               style={styles.webViewStyle}
               renderLoading={this.startLoading}/>
    );
  }
});


var styles = StyleSheet.create({

    webViewStyle:{
      flex:1,
    },

    activityIndicatorIOSStyle:{
      marginTop:100,
      alignItems: 'center', 
      justifyContent: 'center'
    },

});


module.exports = News_DetailView;
